<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/customerinfo/client_visit/q_client_visit.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/customerinfo/client_visit/q_client_visit.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Client_visit',
                footer: "Foots",
                cnName: '拜访客户',
                name: 'client_visit/q_client_visit',
                url: "/q_client_visit/",
                sortName: "Visit_time"
            });
            const editFormFields = ref({"Client":"","Client_flag":"","Visit_way":"","Visit_time":"","Client_man":"","Client_tel":"","Position":"","Visit_num":"","Image":"","Visit_content":""});
            const editFormOptions = ref([[{"dataKey":"客户","data":[],"title":"客户","required":true,"field":"Client","type":"select"},
                               {"dataKey":"客户标志","data":[],"title":"客户标志","field":"Client_flag","type":"select"},
                               {"dataKey":"拜访方式","data":[],"title":"拜访方式","required":true,"field":"Visit_way","type":"select"},
                               {"title":"拜访时间","required":true,"field":"Visit_time","type":"datetime"}],
                              [{"title":"联系人","field":"Client_man","type":"text"},
                               {"title":"联系电话","field":"Client_tel","type":"phone"},
                               {"title":"职位","field":"Position","type":"text"},
                               {"title":"拜访次数","field":"Visit_num","type":"number"}],
                              [{"title":"拜访内容","required":true,"field":"Visit_content","colSize":6,"type":"textarea"},
                               {"title":"图片","field":"Image","type":"img"}]]);
            const searchFormFields = ref({"Creator":"","Client":"","Client_man":"","Client_tel":"","Position":"","Visit_way":"","Visit_time":"","Visit_num":[null,null]});
            const searchFormOptions = ref([[{"dataKey":"客户","data":[],"title":"客户","field":"Client","type":"select"},{"dataKey":"拜访方式","data":[],"title":"拜访方式","field":"Visit_way","type":"select"},{"title":"拜访时间","field":"Visit_time","type":"datetime"},{"title":"创建人员","field":"Creator","type":"like"}],[{"title":"联系人","field":"Client_man","type":"like"},{"title":"联系电话","field":"Client_tel","type":"like"},{"title":"职位","field":"Position","type":"like"},{"title":"拜访次数","field":"Visit_num","type":"range"}]]);
            const columns = ref([{field:'Client_visit',title:'ID',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',link:true,width:100,align:'left',sort:true},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Client',title:'客户',type:'int',bind:{ key:'客户',data:[]},width:80,require:true,align:'left'},
                       {field:'Client_flag',title:'客户标志',type:'string',bind:{ key:'客户标志',data:[]},width:120,align:'left'},
                       {field:'Client_man',title:'联系人',type:'string',width:120,align:'left'},
                       {field:'Client_tel',title:'联系电话',type:'string',width:120,align:'left'},
                       {field:'Position',title:'职位',type:'string',width:110,align:'left'},
                       {field:'Visit_num',title:'拜访次数',type:'int',width:80,align:'left'},
                       {field:'Visit_way',title:'拜访方式',type:'int',bind:{ key:'拜访方式',data:[]},width:100,require:true,align:'left'},
                       {field:'Visit_time',title:'拜访时间',type:'datetime',width:150,require:true,align:'left',sort:true},
                       {field:'Image',title:'图片',type:'img',width:110,align:'left'},
                       {field:'Visit_content',title:'拜访内容',type:'string',width:220,require:true,align:'left'},
                       {field:'Longitude',title:'经度',type:'decimal',width:80,align:'left'},
                       {field:'Latitude',title:'纬度',type:'decimal',width:80,align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'AuditStatus',title:'审核状态',type:'int',width:110,hidden:true,align:'left'},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifyer',title:'修改人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
